package com.linxianqin.springbootVue.domain.convert;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.linxianqin.springbootVue.domain.dto.SysNoticeDTO;
import com.linxianqin.springbootVue.domain.entity.SysNotice;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface SysNoticeConvert {
    SysNoticeConvert INSTANCE = Mappers.getMapper(SysNoticeConvert.class);
    SysNoticeDTO entity2dto(SysNotice role);
    List<SysNoticeDTO> entity2dto(List<SysNotice> role);
    SysNotice dto2entity(SysNoticeDTO roleDTO);

    @Mappings({
            @Mapping(target = "ascs",ignore = true),
            @Mapping(target = "asc",ignore = true),
            @Mapping(target = "descs",ignore = true),
            @Mapping(target = "desc",ignore = true),
    })
    Page<SysNoticeDTO> entity2dto(Page<SysNotice> page);

    @Mappings({
            @Mapping(target = "ascs",ignore = true),
            @Mapping(target = "asc",ignore = true),
            @Mapping(target = "descs",ignore = true),
            @Mapping(target = "desc",ignore = true),
    })
    Page<SysNotice> dto2entity(Page<SysNoticeDTO> page);
}
